Let's turn off our game.
And then I'm going to close this window here, so I have more room.
I'm going to go back to my game window on the screen Gooey.
I'm going to hit the plus sign and add a text label.
The text label.
I'm going to call this info message info, MSG label.
All right.
I'm going to go to anchor point on my info message label.
Make that 0.5 and 0.5 kind of moves up the label a little bit.
We'll go to position.
I'll make this point five scale on the x zero pixel offset point five scale on the Y, zero pixel offset.
There we go.
And for size, let's try maybe 20% of the screen on the x zero pixel offset 20% on the Y zero pixel
offset.
So 0.2 comma zero comma 0.20.
That's not bad.
Go down and change.
I'm not going to change a lot of stuff.
You could decorate this as much as you want.
Maybe go to sand Sand Source pro the font font face.
Let's get our comic font.
And that's pretty small.
So maybe tech scaled.
Cool and then maybe change the tax color.
Like green or something bright, colorful, hard to see.
So we get our text stroke transparency that'll put a little outline around it, read our text, make
that zero.
The default color for that is black, which I usually keep.
And let's get rid of the background color or the background itself on our info gooey.
Go all the way up to the top.
Background.
Transparency.
Set that to one.
All right.
So we have a relatively simple guy here that we're going to call.
I'm going to grab this thing.
I'm going to drag it on up to replicated storage.
We are going to create one of those little message guys every time we process a message.
So my process message script is right here it is under the screen guy if you lost it.
All right, so up here we got our replicated storage.
This is where we're keeping our UI stuff.
Let's do a local.
And what do we call that info?
Message Label info.
I think I'll just call this label, right, because I don't want it to close to my remote event and
we will get replicated storage.
Wait for child info message lvl right.
I think I might call that label template.
That's even better.
That is going to be the template that I to create these messages or these these guys with.
So I'm going to go down where we print.
We're not going to print anymore.
We are going to create a label.
So local label equals label template clown.
Let's make the parent of the label the same as the Scripps parent.
So LBL parent will equal the Scripps parent.
So we're going to put it on the screen Gooey.
All right.
What else do we need?
We need to change the text.
LBL text equals.
And we've got our message cue right, message Q one.
And we want to make sure we do that before we remove it.
Now, I want it to slide.
I want it to be displayed and then go up off the screen.
So how are we going to do that?
This is just going to show it.
I'm going to go to the top of my script and I get a couple more variables.
I'm going to get one for the tween service.
Right?
So tween tween service does animation's we'll do game get service, tween service and what else they
need tween info.
And we did this for the coin stuff.
I'm going to fill this one out a little more just for the sake of education.
So we're going to do our tween info.
No, the first value is the time.
I'll say one second.
The second value is the easing style.
How do you want it to move?
And we're going to do a quadratic, we're going to start slow and then it's going to speed up as it
gets farther up the screen.
So we're going to do e m easing style dot quad, and whether it starts fast or it ends fast is going
to be determined by the easing direction, Right?
So out is where it's going to be faster on the exit.
And then we have this.
Here is repeat count.
So repeat counts going to be going to be zero.
We're not going to repeat it.
What else do we need?
Reverses?
Nope.
We'll make that false.
What else should we do?
The delay time.
We need time to read it.
Let's give it a two second delay before we start moving it.
I'm going to put this on the next line.
Have two lines here so you could see everything.
Right?
So we have this is how this is how long the tween lasts, how it'll move, which direction you could
have like a bounce or whatever, but the speed is going to be at the end.
And then you could read those.
You have the, the annoying pop ups.
They're pretty helpful at START.
But then after you've been coding for about two years, you're going to get annoying.
All right.
So we got that.
What else do we need?
Oh, the goal, right.
I'm going to define the goal of the tween here.
That is the stop position when the tween is finish where we're moving to and how we're doing, how we're
doing the animation.
We're going to animate on position.
So we want the positions goal to be equal to a universal dimension to dot new.
And this is going to have the x scale x pixel, y scale, y pixel.
Let's say 0.5 X scale.
So halfway in the screen, zero pixel offset on the x negative point five on the Y for the scale, zero
pixel offset.
So the -0.5 is up above the screen where you can't see.
We're going to have it slide right up just like the coin, but we're going to have a little fancier
easing stuff, right?
All right.
So we got that stuff taken care of.
Now we go down here after we display our text.
Let's go ahead and make a variable for the tween T.
Yes, create.
And we've got our label, we have our tween info and we have our goal.
Cool.
Now we need to play the tween tween play.
And then I forgot the equals.
I do that a lot.
Get the equals right there.
And now let's go ahead and do the tween, not tween info.
Tween.
Wait.
Or what is it on?
That's it.
Completed.
That's the event.
So that's going to fire when it's done and we're going to wait here.
That's going to induce a delay here.
Right.
It's going to be about 3 seconds.
Right.
We got one second for the tween itself, but we have a two second delay so that when the thing pops
up, it's going to be there.
So that's about a three second delay.
That's not bad.
At the end of all that, let's get our LBL and destroy it so we don't clutter up our client stuff.
I think I'm going to get rid of this weight.
Let's do a control X to cut it.
I'll put a true here and then make sure you paste that weight down here.
Right.
So this is going to take 3 seconds.
If there's nothing in the queue, we're going to pull every one second.
Let's try it out.
Here we go.
And I should have had my output.
There it is.
Message one.
Message to.
Message three.
That's pretty cool now.
The Q itself, once the messages get in the queue, the order is guaranteed.
It's going to be first in, first out.
However, how it gets from the server to the queue is not guaranteed.
The way we've been doing it, it hasn't been a problem.
The first one that gets created is the first one that gets to the queue.
But these are asynchronous calls, these remote events or asynchronous calls and things could slow them
down.
There could be a mismatch in ordering, especially in a regular game where there's a lot going on.
But I think this is good enough.
They have to fire very close to the same time in order to get a confused order.
Now let's go ahead and move this to our zombie game.
So I'm going to need this process, Mzgee.
I'm going to need my info.
Ms..
G.
Label.
And then I'm going to need the remote event.
I'm not really going to need this server stuff.
Where do my server script service, but maybe we'll grab it just in case.
All right, so then I'm going to right click, I'm going to group as model and it puts it in the workspace.
Let me call this message.
Q
And you should probably put a read me file in here.
I'll go ahead and put a read me file and a pause the video.
Then I'll show you what it says.
I created a regular script right here in the message queue model.
I called it read me, I disabled it, so I unchecked enabled.
And then I just put comments here.
Basically I said the message message gen generates test messages on the server side process message
script place on screen guy catches and processes messages from the server via the remote event and I
put the name of the remote event, put the remote event here, told you where to put it, replicated
storage, put the label, told you where to put it, replicated storage.
There we go.
All right, so now we got this.
Let's right click and we're going to save two roadblocks.
Message queue, I think all distributed to the workplace.
I got seven more shares right that way.
You guys can grab it if you need it.
Just look under Symantec, Nitro one for Creations.
All right.
We'll submit this.
It'll be in our toolbox.